<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>报名人数增长</title>
    <style>
        #count {
            color: red
        }
    </style>
</head>
<style>
</style>
<body>
    <div>已有<label id="count"></label>人参与了此次活动 <button onclick="baoMing()">我要报名</button></div>
</body>
<script>
    /**
     * 数字不定期往上增长
     */
    localStorage.setItem('count', '')
    function renderCount() {
        let count = 3000
        const saveCount = Number(localStorage.getItem('count')) || 0
        const d1 = 1668062980222
        const d2 = Date.now()
        const dd = Math.floor((d2 - d1) / 3000)
        count += dd
        count += saveCount
        document.getElementById('count').innerHTML = count
    }
    function baoMing() {
        localStorage.setItem('count', 1)
        renderCount()
    }
    setInterval(() => renderCount(), 1000)
    renderCount()
</script>
</html>